package com.agan.aganalgorithm.titles;

/**
 * @author agan
 * @ClassName DemoMaoPao
 * @Description
 * @Date 2021/3/31 9:55 上午
 **/
public class DemoMaoPao {

    public static void main(String[] args){

        int[] numbers = new int[]{1,23,4,221,3};

        for(int i =0 ; i<numbers.length -1 ;i++){
            for (int j =0;j<numbers.length-1-i;j++){
                if(numbers[j] > numbers[j+1]){
                    int temp= numbers[j];
                    numbers[j] = numbers[j+1];
                    numbers[j+1] = temp;
                }
            }


        }

        for (int i=0;i<numbers.length;i++){
            System.out.println(numbers[i]);
        }


    }

}
